using System;
using System.IO;
namespace ProcessesSMS
{
	/// <summary>
	/// Summary description for MUAVN.
	/// </summary>
	public class MUAVN
	{
		#region Declare		
		private SMS_MO WMO;
		private SMS_MT WMT;		
		//ArrayList arr = new ArrayList();
		public MUAVN(SMS_MO MO)
		{
			WMO = MO;
		}

		public MUAVN()
		{
		}
		#endregion
		#region Method
		public void run()
		{
			WMT = new SMS_MT(WMO);
			string tmpMsg = WMO.Message.Substring(WMO.CommandCode.Length).Trim().Replace("  ", " ").Replace("  ", " ");
			tmpMsg = tmpMsg.Replace("  ", " ").Trim().ToUpper();
			//string[] msg = tmpMsg.Split(new char[] { ' ' });
			TextWriter twriter = new StreamWriter("MUAVN\\" + WMO.CommandCode.ToUpper() + "_" + WMO.MO_ID + ".txt");
			twriter.Write(WMO.MO_ID + "," + WMO.UserID + "," + WMO.ServiceID + "," + WMO.CommandCode + "," + tmpMsg + "," + WMO.RequestID);
			twriter.Close();			
			return;
		}
		#endregion
	}
}
